package com.pro.db.enums;


import com.pro.db.util.CollectionUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * 是否结账
 *
 * @author wanglei
 *
 */
public enum EnumContentType {

	CONTENT_TITLE(0, "标题"),
	CONTENT_RICHTEXT(1, "富文本内容"),
	CONTENT_ARTICLE_LIST(2, "文章列表"),
	CONTENT_VIDEO_LIST(3, "视频列表"),
	CONTENT_IMAGE_LIST(4, "图片列表");

	private Integer key;

	private String value;

	EnumContentType(Integer key, String value) {
		this.key = key;
		this.value = value;
	}

	public Integer getKey() {
		return key;
	}

	public void setKey(Integer key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	private static final Map<Integer, EnumContentType> map;

	static {
		map = new HashMap<Integer, EnumContentType>(CollectionUtils.capacitySize(values().length));
		for(EnumContentType tag : values()) {
			map.put(tag.getKey(), tag);
		}
	}

	public static EnumContentType get(Integer key) {
		if (null == key) {
			return null;
		}
		return map.get(key);
	}
}
